package com.feihong.yw189.activity.WebInterface;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;

import com.feihong.yw189.activity.shouye.MoreActivity;
import com.just.agentweb.AgentWeb;

/**
 * js交互接口
 * 首页   更多web
 */

public class MoreWebInterface {
    private final String TAG = "营维189";
    private AgentWeb agent;
    private Context context;
    private MoreActivity.ActionCallBack callBack;

    public MoreWebInterface(AgentWeb agent, Context context, MoreActivity.ActionCallBack callBack) {
        this.agent = agent;
        this.context = context;
        this.callBack = callBack;
    }

    private Handler deliver = new Handler(Looper.getMainLooper());

    /*读身份证*/
    @JavascriptInterface
    public String get_card(String info){
        return callBack.get_card(info);
    }

     /*拍照*/
    @JavascriptInterface
    public Boolean get_images(String info){

        return callBack.get_images(info);
    }

    /*联系客服*/
    @JavascriptInterface
    public String get_service(String info){

        return callBack.get_service(info);
    }
    /**/
    @JavascriptInterface
    public String lt_qdpd(){

        return callBack.lt_qdpd();
    }

    /*复制粘贴到剪贴板*/
    @JavascriptInterface
    public String copy_text(String info){
        return callBack.copy_text(info);
    }

    /*保存本地*/
    @JavascriptInterface
    public String dow_images(String info){
        return callBack.dow_images(info);
    }
    /*接口信息*/
    @JavascriptInterface
    public void ajax(String info){
        callBack.netWork(info);
    }

    /**
     * 扫描二维码
     * @param info
     */
    @JavascriptInterface
    public void get_code(String info){
        callBack.getZCode(info);
    }

    /**
     * 刷新定位置
     */
    @JavascriptInterface
    public void refresh_gps(){
       callBack.refresh_gps();
    }
    @JavascriptInterface
    public void go_back(){
        callBack.go_back();
    }
}
